<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据类型转换之计算年龄案例</title>
    <script>
        var brith_year = prompt('请输入你的出生年份: ');
        var age = 2020 - brith_year;  // birth_year取过来的是字符串类型，但是这里用是减法，有隐式转换
        alert('你的年龄是: ' +  age + '岁');
    </script>
</head>
<body>
    
</body>
</html>